<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>登录</title>
</head>
<link rel="stylesheet" href="__static__/css/user.css" />
<link href='http://fonts.googleapis.com/css?family=Oleo+Script' rel='stylesheet' type='text/css'>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script language="javascript" src="__static__/common/sign.js"></script>
<script language="javascript"  src="__static__/common/json.js"></script>
<script language="javascript" src="__static__/common/md5.js"></script>
<script language="javascript" src="__static__/common/base64.js"></script>
<script language="javascript" src="__static__/js/url.js"></script>

<body>
<div class="lg-container">
    <h1>User Area</h1>
    <form action="#" id="lg-form" name="lg-form" method="post">

        <div>
            <label for="username">Username:</label>
            <input type="text" name="username" id="username" placeholder="username"/>
        </div>

        <div>
            <label for="password">Password:</label>
            <input type="password" name="password" id="password" placeholder="password" />
        </div>

        <div>
            <button type="button" id="login">Login</button>
        </div>

        <div align="center">
            <a href="#" onclick="register()">没有账号？注册</a>
        </div>
    </form>
    <div id="message"></div>
</div>

</body>
<!--页面标签-->
<!--<script>
    $(document).ready(function(){
        $("#login").click(function(){

            var action = $("#lg-form").attr('action');
            var form_data = {
                username: $("#username").val(),
                password: $("#password").val(),
                is_ajax: 1
            };

            $.ajax({
                type: "POST",
                url: action,
                data: form_data,
                success: function(response)
                {
                    if(response == "200")
                        $("#lg-form").slideUp('slow', function(){
                            $("#message").html('<p class="success">You have logged in successfully!</p><p>Redirecting....</p>');
                        });
                    else{
//                        $("#message").html('<p class="error">ERROR: Invalid username and/or password.</p>');
                    }

                }
            });
            return false;
        });
    });
</script>-->

<!--ajax 登录-->
<script language="javascript" src="__static__/js/user.js"></script>
<script>
    $(function () {
        $('#login').click(function () {
            var username = $('#username').val();
            var password = $('#password').val();
            userLogin(username,password);
        })
    })
    //注册页面跳转
    function register() {
        location.href =url_list.register;
    }
</script>

</html>